//
//  ContextTest.m
//  OpenGL ES 2
//
//  Created by Francisco Valbuena on 9/12/11.
//  Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//

#import "ContextTest.h"

static NSString *ContextTestKey = @"ContextTestKey";

@implementation ContextTest


+ (ContextTest *)currentContext
{
    NSThread *currentThread               = [NSThread currentThread];
    NSMutableDictionary *threadDictionary = [currentThread threadDictionary];
    
    ContextTest *currentContext = [threadDictionary valueForKey:ContextTestKey];
    
    return currentContext;
}

+ (void)setCurrentContext:(ContextTest *)context
{
    NSThread *currentThread               = [NSThread currentThread];
    NSMutableDictionary *threadDictionary = [currentThread threadDictionary];
    
    //[EAGLContext setCurrentContext:context._EAGLContext];
    [threadDictionary setValue:context forKey:ContextTestKey];
}

- (void)doSomething
{
    //NSLog(@"something done");
}

@end
